package com.edocbase.desktop.maildriver;

import com.edocbase.diary.job.IJobProgressListener;
import com.edocbase.webdriver.DriverException;
import com.edocbase.webdriver.IDriver;
import com.edocbase.webdriver.IWebAccount;
import com.edocbase.webdriver.WebDriverManager;
import com.edocbase.webdriver.mail.MailDriver;

public abstract class AbstractDriverCommand {
	protected IDriver driver;
	protected IWebAccount account = null; 
	public AbstractDriverCommand(IWebAccount account) throws DriverException {
		super();
		this.account = account;
		driver = WebDriverManager.getManager().getDriver(this.account);
		if (driver.getDriverStore() == null){
			driver.setDriverStore(new MailDriverStore((MailDriver) driver));
		}
	}

	public abstract void execute(IJobProgressListener jobListener) throws Exception;
	
	public abstract void stop();
	
//	public abstract IJobProgressListener getProgressListener();
}
